package com.ytt.core.service.entity.authority;

import com.ytt.core.service.entity.AbstractBaseEntity;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Authority
 *
 * @author chenwen
 * @date 2019/9/16 16:55
 */
@Entity
@Table(name = "sys_authority")
@Getter
@Setter
public class Authority extends AbstractBaseEntity {
    /**
     * 权限编号, 要求唯一性。需要使用"数据类型_操作类型"的形式
     * 操作类型为CRUD, 建议使用CREATE, RETRIEVE, UPDATE, DELETE(请使用\"数据类型_操作类型\"的形式")
     */
    @Column(name = "code", length = 50, nullable = false, unique = true)
    private String code;

    /**
     * 权限名称
     */
    @Column(name = "name", length = 100, nullable = false, unique = true)
    private String name;

    /**
     * 权限所属的类型
     */
    @Column(name = "type", nullable = false, length = 50)
    private String type;


    @Override
    public boolean equals(Object o) {
        return super.equals(o);
    }

    @Override
    public int hashCode() {
        return super.hashCode();
    }
}
